package com.iflyun.springBootMybatis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageHelper;
import com.iflyun.springBootMybatis.dao.UserLogsDao;
import com.iflyun.springBootMybatis.entity.UserLogs;

@RestController
@RequestMapping("/")
public class Controller {
	
	@Autowired
	private UserLogsDao userLogsDao;
	
	@RequestMapping("home")
	public String home(){
		UserLogs user=userLogsDao.getById("2b7f4267-8f08-4f5e-9808-5b435d9fb0c6");
		return user.getIp();
	}
	
	@RequestMapping("login")
	public String login(){
		PageHelper.startPage(1,1);
		List<UserLogs> list=userLogsDao.getList();
		System.out.println(list.size());
		return list.get(0).getIp();
	}

}
